The present invention relates to a process and a device for synchronizing the presentation of video frames and/or audio frames generated from a data stream comprising time stamps indicating instants of presentation of the frames. It applies more particularly to a compressed data stream read from a mass recording digital medium. The compressed data stream may be a data stream compressed according to the MPEG-2 standard (ISO/IEC 13812-2), hereinafter the MPEG standard.
The frames are produced by an MPEG decoder from an MPEG data stream broadcast live by a transmission source (broadcasting by satellite, broadcasting by cable or digital terrestrial broadcasting or DVB (“Digital Video Broadcasting”)). They belong to an audiovisual program or to several audiovisual programs multiplexed in the data stream.
The frames are synchronized just before their presentation, with respect to a clock generated from the time references forwarded by the transmission source in the data stream. These time references are called “Program Clock References” or PCRS, in the MPEG standard. They are inserted into the MPEG data stream in synchronism with a clock which regulates the MPEG coding of the frames. They make it possible, with the aid of a PLL (“Phase Locked Loop”) circuit or the like, to generate on the decoding side a reference clock tied to the program. This clock is called a program clock in what follows.
The data stream also comprises presentation time stamps indicating respective instants of presentation of the frames. These time stamps make it possible to synchronize the presentation of the frames with respect to the program clock. They are called “Presentation Time Stamps”, or PTSs, in the MPEG standard. The decoding and the displaying of the frames are then performed by complying with the real-time constraints in such a way that the frames are presented at instants defined by the PTSs in relation to the program clock. Although the video decoding and the audio decoding are separate procedures, each video frame and each audio frame is synchronized with the program clock so that they are presented at one and the same determined instant. Stated otherwise, the video frames and the audio frames are each synchronized with the program clock and are also synchronized with one another.
When the data stream from which the frames are produced is not received in real time, but is read from a mass recording digital medium such as a hard disk or a DVD (“Digital Video Disk”), the concept of real time is lost. Specifically, even if the data stream stored on the medium in the form of an elementary stream (or ES) or a packetized elementary stream (or PES) still comprises the PCRs and the PTSs, the decoding procedure is carried out in a very different manner. Specifically, there is provision for much more considerable buffering than in the case of real-time decoding. Likewise, there is a large difference with regard to the supplying of the data. Specifically, the rate of supply of the data may be much higher and may be in burst mode. This results from the specific way in which the accesses to the hard disk are made with respect to the reading of portions of the data stream.
Moreover, the synchronization must be preserved during reading according to advanced modes of reading (“trick modes”) such as fast forward and rewind, and when random accesses to the hard disk are required. Also, the synchronization must be preserved when passing from the presentation of a program received in real time to that of a program read on hard disk, or vice versa, or from the presentation of a first program to a second program read on a hard disk, or else during the insertion of an advertising or other sequence into the presentation of a program (“seamless splicing”).